import kgRequest from '@/service'
import type { IEntireRolesReturn,IEntireMenuListReturn } from './type'

enum apiUrls {
  ENTIRE_ROLES = 'system/role',
  ENTIRE_MENUS = 'system/menu',
  ENTIRE_ROLE='system/menu/get',
  ENTIRE_PASSWORD='/password',
  UPLOAD_IAMGE='upload/image',
  ENTIRE_REMARK='/remark'
}

export function postEntireRolesApi(data) {
  return kgRequest.post<IEntireRolesReturn>({
    url: apiUrls.ENTIRE_ROLES,
    data
  })
}

export function postEntireMenusApi() {
  return kgRequest.post<IEntireMenuListReturn>({
    url: apiUrls.ENTIRE_MENUS,
    data:{
      pageNumber: 1,
      pageSize: 99999
    }
  })
}

export function postEntireRoleApi(id:number) {
  return kgRequest.post<IEntireRolesReturn>({
    url: apiUrls.ENTIRE_ROLE,
    data:id
  })
}

//修改密码

export function postPasswordApi(data:any) {
  return kgRequest.post({
    url: apiUrls.ENTIRE_PASSWORD,
    data
  })
}


//上传图片
export function postUploadImageApi(data:any) {
  return kgRequest.post({
    url: apiUrls.UPLOAD_IAMGE,
    data
  })
}

//新建图片上传
export function postNoticeUploadImageApi(data:any,url:string) {
  return kgRequest.post({
    url,
    data
  })
}

 //设置备注（用户或群聊）
 export function postEntireRemarkApi(data) {
  return kgRequest.post({
    url: apiUrls.ENTIRE_REMARK,
    data
  })
}
